package labox.innovation.loginserver.gameserverpackets;


/**
 * 接受游戏服务器发过来的注册请求
 *
 */
public class GameServerAuth extends ClientBasePacket {
	
	private int _desiredId;

	private boolean _acceptAlternativeId;

	private int _maxPlayers;

	private int _port;

	private String _externalHost;
	
	private String _externalIP;

	private String _internalIP;
	
	private int _serverType;

	/**
	 * @param decrypt
	 */
	public GameServerAuth(byte[] decrypt) {
		super(decrypt);
		_desiredId = readUnByte();
		_acceptAlternativeId = (readUnByte() == 0 ? false : true);
		_externalHost = readString();
		_externalIP = readString();
		_internalIP = readString();
		_port = readUnShort();
		_maxPlayers = readInt();
		_serverType=readInt();
	}

	/**
	 *  返回游戏服务器请求注册的ID
	 * @return
	 */
	public int getDesiredID() {
		return _desiredId;
	}

	/**
	 * 是否接受登陆服务器的修改ID操作
	 * @return
	 */
	public boolean acceptAlternateID() {
		return _acceptAlternativeId;
	}

	/**
	 * @return Returns the max players.
	 */
	public int getMaxPlayers() {
		return _maxPlayers;
	}

	/**
	 * @return Returns the externalHost.
	 */
	public String getExternalHost() {
		return _externalHost;
	}
	
	public String getExternalIP(){
		return _externalIP;
	}

	/**
	 * @return Returns the internalHost.
	 */
	public String getInternalIP() {
		return _internalIP;
	}

	/**
	 * @return Returns the port.
	 */
	public int getPort() {
		return _port;
	}
	
	public int getServerType(){
		return _serverType;
	}
}
